<?php

namespace IDock\Insurance\DAJIA\Request;

use Exception;
use IDock\Insurance\DAJIA\Response\RenewalInquiryResponse;
use IDock\Visitor\RenewalInquiryVisitor;

class RenewalInquiryRequest extends AllDAJIARequest
{
    protected $code = 'VHL-INS2007';

    protected $response = RenewalInquiryResponse::class;

    protected $urlTip = '续保查询';

    /*** @var  RenewalInquiryVisitor $visitor */
    protected $visitor;

    /**
     * @return array
     * @throws Exception
     */
    public function generate(): array
    {
        $param = [
            'plyNo' => $this->visitor->argc['inquiryNo'] ?? [],//投保单号
            'startTm' => date('Y-m-d',strtotime("-1 month")),//保单终止日期的开始时间
            'endTm' => '',//保单终止日期的结束时间
            'appNme' => '',//投保人姓名
            'plateNo' => $this->visitor->licenseNo ?? '',//车牌号码
            'refCde' => '',//车牌号码
            'dptCde' => '',//车牌号码
            'frmNo' => $this->visitor->vin,//车架号
            'engNo' => $this->visitor->engineNo,//发动机号，车牌号码
        ];
        return $param;
    }
}